$OpenBSD: patch-src_Lua_cpp,v 1.2 2016/07/09 12:14:28 sthen Exp $
--- src/Lua.cpp.orig	Mon Jun 27 20:31:18 2016
+++ src/Lua.cpp	Sat Jul  9 12:55:43 2016
@@ -3134,8 +3134,8 @@ static int ntop_generate_csrf_value(lua_State* vm) {
   ntop->getTrace()->traceEvent(TRACE_INFO, "%s() called", __FUNCTION__);
 
 #ifdef __OpenBSD__
-  snprintf(random_a, sizeof(random_a), "%d", arc4random());
-  snprintf(random_b, sizeof(random_b), "%lu", time(NULL)*arc4random());
+  arc4random_buf(random_a, sizeof(random_a) - 1);
+  arc4random_buf(random_b, sizeof(random_b) - 1);
 #else
   snprintf(random_a, sizeof(random_a), "%d", rand());
   snprintf(random_b, sizeof(random_b), "%lu", time(NULL)*rand());
